﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace Business.Models
{
    public class DiaDiem
    {
        [Key]
        [Required]
        public int IdDiaDiem { get; set; }
        [Required]
        public string TenDiaDiem { get; set; }
        [Required]
        public string TenDiaDiem_Alias { get; set; }
    }
    public class DiaDiemConfiguration : EntityTypeConfiguration<DiaDiem>
    {

        public DiaDiemConfiguration()
            : base()
        {

            HasKey(d => d.IdDiaDiem);
            Property(d => d.IdDiaDiem).
                HasColumnName("IdDiaDiem").
                HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).
                IsRequired();
            Property(d => d.TenDiaDiem).
                HasColumnName("TenDiaDiem").
                IsRequired();
            Property(d => d.TenDiaDiem_Alias).
                HasColumnName("TenDiaDiem_Alias").
                IsRequired();
            ToTable("DiaDiem", "dbo");
        }

    }
}